import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: () => import('@/views/home')
    },
    {
        path: '/last',
        component: () => import('@/views/last')
    },
    {
        path: '/question',
        component: () => import('@/views/question'),
        beforeEnter(to,from,next){
            let complated = localStorage.getItem('complated');
            if(complated){
                next(false)
            }else{
                next()
            }
        }
    }
  ]
})
